//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.chenyue.cm.decrypt;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;

public class SecretHmacSHA1 implements Secret<byte[], String> {
    private SecretKeySpec c;
    private Mac m;

    public SecretHmacSHA1(String secretKey) {
        try {
            this.m = Mac.getInstance("HmacSHA1");
            this.m.init(this.c = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), "HmacSHA1"));
        } catch (Exception var3) {
            var3.printStackTrace();
        }

    }

    @Override
    public byte[] encrypt(String plaintext) {
        try {
            return this.m.doFinal(plaintext.getBytes(StandardCharsets.UTF_8));
        } catch (Exception var3) {
            var3.printStackTrace();
            return null;
        }
    }

    @Override
    public String decrypt(String ciphertext) {
        return ciphertext;
    }
}
